#include<reg52.h>
typedef unsigned char u8;
typedef unsigned int u16;
sbit LED = P2^3;
sbit MOTO = P1^0;	
u8 dat;
void Init(void)		
{
	TMOD = 0x20;	
	TL1 = 0xfd;		
	TH1 = 0xfd;		
	TR1 = 1;	
	REN=1;    
	SM0=0;    
	SM1=1;   
	EA = 1;   
	ES=1;     
}

void main()
{
    Init();
    while(1);
}



void InterruptUART() interrupt 4   
{ 
      RI = 0;        
      dat = SBUF;    
	  {
         if(dat=='o')
		 {
			 LED =0;    
		 }
		 if(dat=='f')  
		 {						 
		     LED =1; 
		 }			
		 if (dat == 'a')
			 MOTO = 1;
		 if (dat == 'b')
			 MOTO = 0;
	  }
}
